<template>
	<view class="all">
		<view class="top">
			<image :src="info.WeChat_accounts" mode="widthFix" />
			<!-- <image src="https://s4.ax1x.com/2022/02/08/H1UShR.png" mode="widthFix" /> -->
		</view>
		<view class="all_centent_2">
			<view class="carp" :style="{
			'border-bottom':index!=list.length-1?'1rpx solid #EFEFEF':''
			}" @click="submit(item)" v-for="(item,index) in list">
				<text class="text_1">{{item.name}}</text>
				<view class="carp_1">
					<text v-if="item.text">{{item.text}}</text>
					<!-- <u-icon name="arrow-right" size="25" color='#91969A ' /> -->
				</view>
			</view>
		</view>
		<view class="all_centent_2">
			<view class="carp" :style="{
			'border-bottom':index!=list.length-1?'1rpx solid #EFEFEF':''
			}" @click="submit(item)" v-for="(item,index) in list1">
				<text class="text_1">{{item.name}}</text>
				<view class="carp_1">
					<text v-if="item.text">{{item.text}}</text>
					<u-icon name="arrow-right" size="25" color='#91969A ' />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},
				list1: [{
						name: "服务使用协议",
						text: '',
					},
					{
						name: "隐私协议",
						text: ''
					},
					{
						name: "证照信息",
						text: ''
					},
				],
				list: [{
						name: "客服电话",
						text: '400-1452-512',
					},
					{
						name: "我的邮箱",
						text: 'zhiwuhui@163.com'
					}
				]
			};
		},
		onLoad() {
			this.$api('usermsg/about').then(res => {
				this.info = res.data
				this.list.forEach(v => {
					if (v.name == '客服电话') {
						v.text = res.data.customer_service
					} else if (v.name == '我的邮箱') {
						v.text = res.data.e_mail
					}
				})
				console.log(this.info)
			})
		},
		methods: {
			submit(a) {
				if (a.name == '服务使用协议' || a.name == '隐私协议' || a.name == '证照信息') {
					let data = {
						name: a.name,
						data: null
					}
					if (a.name == '服务使用协议') {
						data.data = this.info.service
					} else if (a.name == '隐私协议') {
						data.data = this.info.privacy
					} else {
						data.data = this.info.licence
					}
					uni.navigateTo({
						url: `./zzxx?data=${JSON.stringify(data)}`
					})
				}
			}
		}
	}
</script>
<style lang="scss">
	.all {
		.all_centent_2 {
			margin-top: 20rpx;
			padding: 0rpx 30rpx 0rpx 30rpx;
			background-color: white;
		}

		.carp:active {
			background-color: rgba($color: #999999, $alpha: 0.1);
		}

		.jiange {
			height: 15rpx;
			background-color: #F6F6F6;
		}

		.carp {
			// border-bottom: 1rpx solid #EFEFEF;
			padding: 35rpx 0 35rpx 0;
			display: flex;
			justify-content: space-between;

			.carp_1 {
				text {
					font-size: 26rpx;
					font-family: Source Han Sans CN;
					color: #999999;
					margin-right: 10rpx;
					opacity: 1;
				}
			}

			.text_1 {
				font-size: 30rpx;
				font-family: Source Han Sans CN;
				color: #333333;
				font-weight: 600;
				opacity: 1;
			}
		}
	}
</style>

<style lang="scss">
	.all {
		min-height: 1300rpx;
		background-color: #F6F6F6;

		.top {
			width: 100%;
			background-color: #FFFFFF;
			text-align: center;

			image {
				width: 280rpx;
				height: 280rpx;
				margin: 80rpx 0 80rpx 0;

			}
		}
	}
</style>
